package com.ecoolex.union.pay.retailer.enums;


import com.ecoolex.framework.common.EnumInterface;


public enum DirectMailGoodsOrderStatus implements EnumInterface<DirectMailGoodsOrderStatus, String> {
    UNPAID("01", "待支付"),
    CANCEL("02", "已取消"),
    AUTO_CANCEL("03", "自动取消"),
    PAID("04", "待发货"),
    WAIT_RECECEIVE("05", "待收货"),
    CLOSED("10", "交易关闭"),
    COMPLETE("11", "已完成"),
    AFTER_SALES("12","售后中");


    private final String real;

    private final String describe;

    DirectMailGoodsOrderStatus(String real, String describe) {
        this.real = real;
        this.describe = describe;
    }

    @Override
    public String real() {
        return real;
    }

    @Override
    public String describe() {
        return describe;
    }
    
    public static boolean canRefund(String status) {
        return PAID.equal(status);
    }

    public static boolean canDelete(String status) {
        return CANCEL.equal(status) || AUTO_CANCEL.equal(status) || CLOSED.equal(status) || COMPLETE.equal(status);
    }

    public static boolean canCancel(String status) {
        return UNPAID.equal(status);
    }

    public static boolean canAutoCancel(String status) {
        return UNPAID.equal(status);
    }

    public static boolean canPay(String status) {
        return UNPAID.equal(status);
    }

    /**
     * 能退换货
     * @param status 当前订单状态
     * @return 能退换货
     */
    public static boolean canReturnAndExchange(String status) {
    	return WAIT_RECECEIVE.equal(status);
    }


    /**
     * 能确认收货
     * @param status 当前订单状态
     * @return 能确认收货
     */
    public static Boolean canConfirmReceipt(String status) {
        return WAIT_RECECEIVE.equal(status);
    }

    /**
     * 是否修改配送信息
     * @param status 当前订单状态
     * @return 是否修改配送信息
     */
    public static boolean canEditShippedInfo(String status) {
        return PAID.equal(status) || UNPAID.equals(status);
    }

    /**
     * 是否能发货
     * @param status 当前订单状态
     * @return 是否能发货
     */
    public static boolean canShipped(String status) {
        return PAID.equal(status);
    }

    /**
     * 是否能修改收件人信息
     * @param status 当前订单状态
     * @return 是否能修改收件人信息
     */
    public static boolean canEditReceiver(String status) {
        return PAID.equal(status);
    }

    /**
     *  是否能操作寄件人信息
     * @param status 当前订单状态
     * @return 是否能操作寄件人信息
     */
    public static boolean canEditSender(String status) {
        return PAID.equal(status);
    }

}
